<script setup lang="ts">
import { defineEmits, defineProps } from 'vue'
import { useI18n } from 'vue-i18n'

const { t } = useI18n()

const props = defineProps({
  modelValue: {
    type: Boolean,
    required: true
  }
})

const emit = defineEmits(['update:modelValue'])

const close = () => {
  emit('update:modelValue', false)
}
</script>

<template>
  <div v-if="modelValue" class="modal-mask">
    <div class="modal-container">
      <div class="modal-header">
        <div class="modal-title">{{ t('question_modal_title') }}</div>
        <div class="modal-close" @click="close">
          <span>×</span>
        </div>
      </div>
      <div class="modal-content">
        <ul>
          <li>{{ t('question_modal_1') }}</li>
          <li>{{ t('question_modal_2') }}</li>
          <li>{{ t('question_modal_3') }}</li>
          <li>{{ t('question_modal_4') }}</li>
        </ul>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.modal-mask {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #232626;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  padding: 32px 20px 24px 20px;
  color: #fff;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  flex: 1;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: #353b3c;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 12px;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
}

.modal-content {
  font-size: 15px;
  line-height: 1.8;
  ul {
    padding-left: 18px;
    margin: 0;
  }
  li {
    margin-bottom: 12px;
    list-style: disc;
    word-break: break-all;
  }
}
</style>
